Termination w.r.t. Q of the following Term Rewriting System could not be shown:

Q restricted rewrite system:
The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

MARK(p(X)) → ACTIVE(p(mark(X)))
ACTIVE(p(0)) → MARK(0)
ACTIVE(diff(X, Y)) → P(X)
MARK(leq(X1, X2)) → MARK(X2)
MARK(diff(X1, X2)) → MARK(X2)
ACTIVE(p(s(X))) → MARK(X)
MARK(true) → ACTIVE(true)
MARK(if(X1, X2, X3)) → MARK(X1)
IF(X1, X2, mark(X3)) → IF(X1, X2, X3)
MARK(leq(X1, X2)) → MARK(X1)
LEQ(X1, mark(X2)) → LEQ(X1, X2)
LEQ(X1, active(X2)) → LEQ(X1, X2)
MARK(p(X)) → MARK(X)
ACTIVE(diff(X, Y)) → IF(leq(X, Y), 0, s(diff(p(X), Y)))
DIFF(X1, active(X2)) → DIFF(X1, X2)
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
S(active(X)) → S(X)
MARK(false) → ACTIVE(false)
P(active(X)) → P(X)
MARK(leq(X1, X2)) → LEQ(mark(X1), mark(X2))
ACTIVE(diff(X, Y)) → S(diff(p(X), Y))
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
ACTIVE(leq(0, Y)) → MARK(true)
MARK(diff(X1, X2)) → MARK(X1)
DIFF(active(X1), X2) → DIFF(X1, X2)
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
P(mark(X)) → P(X)
ACTIVE(diff(X, Y)) → LEQ(X, Y)
LEQ(mark(X1), X2) → LEQ(X1, X2)
MARK(s(X)) → ACTIVE(s(mark(X)))
DIFF(mark(X1), X2) → DIFF(X1, X2)
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
ACTIVE(diff(X, Y)) → DIFF(p(X), Y)
IF(X1, mark(X2), X3) → IF(X1, X2, X3)
MARK(s(X)) → S(mark(X))
S(mark(X)) → S(X)
IF(X1, X2, active(X3)) → IF(X1, X2, X3)
MARK(if(X1, X2, X3)) → IF(mark(X1), X2, X3)
ACTIVE(leq(s(X), s(Y))) → LEQ(X, Y)
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
IF(mark(X1), X2, X3) → IF(X1, X2, X3)
IF(active(X1), X2, X3) → IF(X1, X2, X3)
MARK(p(X)) → P(mark(X))
ACTIVE(leq(s(X), 0)) → MARK(false)
DIFF(X1, mark(X2)) → DIFF(X1, X2)
LEQ(active(X1), X2) → LEQ(X1, X2)
IF(X1, active(X2), X3) → IF(X1, X2, X3)
MARK(0) → ACTIVE(0)
MARK(diff(X1, X2)) → DIFF(mark(X1), mark(X2))
MARK(leq(X1, X2)) → ACTIVE(leq(mark(X1), mark(X2)))
ACTIVE(if(true, X, Y)) → MARK(X)

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

MARK(p(X)) → ACTIVE(p(mark(X)))
ACTIVE(p(0)) → MARK(0)
ACTIVE(diff(X, Y)) → P(X)
MARK(leq(X1, X2)) → MARK(X2)
MARK(diff(X1, X2)) → MARK(X2)
ACTIVE(p(s(X))) → MARK(X)
MARK(true) → ACTIVE(true)
MARK(if(X1, X2, X3)) → MARK(X1)
IF(X1, X2, mark(X3)) → IF(X1, X2, X3)
MARK(leq(X1, X2)) → MARK(X1)
LEQ(X1, mark(X2)) → LEQ(X1, X2)
LEQ(X1, active(X2)) → LEQ(X1, X2)
MARK(p(X)) → MARK(X)
ACTIVE(diff(X, Y)) → IF(leq(X, Y), 0, s(diff(p(X), Y)))
DIFF(X1, active(X2)) → DIFF(X1, X2)
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
S(active(X)) → S(X)
MARK(false) → ACTIVE(false)
P(active(X)) → P(X)
MARK(leq(X1, X2)) → LEQ(mark(X1), mark(X2))
ACTIVE(diff(X, Y)) → S(diff(p(X), Y))
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
ACTIVE(leq(0, Y)) → MARK(true)
MARK(diff(X1, X2)) → MARK(X1)
DIFF(active(X1), X2) → DIFF(X1, X2)
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
P(mark(X)) → P(X)
ACTIVE(diff(X, Y)) → LEQ(X, Y)
LEQ(mark(X1), X2) → LEQ(X1, X2)
MARK(s(X)) → ACTIVE(s(mark(X)))
DIFF(mark(X1), X2) → DIFF(X1, X2)
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
ACTIVE(diff(X, Y)) → DIFF(p(X), Y)
IF(X1, mark(X2), X3) → IF(X1, X2, X3)
MARK(s(X)) → S(mark(X))
S(mark(X)) → S(X)
IF(X1, X2, active(X3)) → IF(X1, X2, X3)
MARK(if(X1, X2, X3)) → IF(mark(X1), X2, X3)
ACTIVE(leq(s(X), s(Y))) → LEQ(X, Y)
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
IF(mark(X1), X2, X3) → IF(X1, X2, X3)
IF(active(X1), X2, X3) → IF(X1, X2, X3)
MARK(p(X)) → P(mark(X))
ACTIVE(leq(s(X), 0)) → MARK(false)
DIFF(X1, mark(X2)) → DIFF(X1, X2)
LEQ(active(X1), X2) → LEQ(X1, X2)
IF(X1, active(X2), X3) → IF(X1, X2, X3)
MARK(0) → ACTIVE(0)
MARK(diff(X1, X2)) → DIFF(mark(X1), mark(X2))
MARK(leq(X1, X2)) → ACTIVE(leq(mark(X1), mark(X2)))
ACTIVE(if(true, X, Y)) → MARK(X)

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 6 SCCs with 17 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

DIFF(X1, active(X2)) → DIFF(X1, X2)
DIFF(active(X1), X2) → DIFF(X1, X2)
DIFF(X1, mark(X2)) → DIFF(X1, X2)
DIFF(mark(X1), X2) → DIFF(X1, X2)

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

DIFF(X1, active(X2)) → DIFF(X1, X2)
DIFF(active(X1), X2) → DIFF(X1, X2)
DIFF(X1, mark(X2)) → DIFF(X1, X2)
DIFF(mark(X1), X2) → DIFF(X1, X2)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

IF(X1, mark(X2), X3) → IF(X1, X2, X3)
IF(X1, X2, active(X3)) → IF(X1, X2, X3)
IF(X1, active(X2), X3) → IF(X1, X2, X3)
IF(X1, X2, mark(X3)) → IF(X1, X2, X3)
IF(active(X1), X2, X3) → IF(X1, X2, X3)
IF(mark(X1), X2, X3) → IF(X1, X2, X3)

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

IF(X1, mark(X2), X3) → IF(X1, X2, X3)
IF(X1, X2, active(X3)) → IF(X1, X2, X3)
IF(X1, active(X2), X3) → IF(X1, X2, X3)
IF(X1, X2, mark(X3)) → IF(X1, X2, X3)
IF(mark(X1), X2, X3) → IF(X1, X2, X3)
IF(active(X1), X2, X3) → IF(X1, X2, X3)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

LEQ(active(X1), X2) → LEQ(X1, X2)
LEQ(X1, mark(X2)) → LEQ(X1, X2)
LEQ(X1, active(X2)) → LEQ(X1, X2)
LEQ(mark(X1), X2) → LEQ(X1, X2)

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

LEQ(active(X1), X2) → LEQ(X1, X2)
LEQ(X1, mark(X2)) → LEQ(X1, X2)
LEQ(X1, active(X2)) → LEQ(X1, X2)
LEQ(mark(X1), X2) → LEQ(X1, X2)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

S(mark(X)) → S(X)
S(active(X)) → S(X)

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

S(active(X)) → S(X)
S(mark(X)) → S(X)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

P(active(X)) → P(X)
P(mark(X)) → P(X)

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

P(active(X)) → P(X)
P(mark(X)) → P(X)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

MARK(diff(X1, X2)) → MARK(X1)
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(p(X)) → ACTIVE(p(mark(X)))
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
MARK(diff(X1, X2)) → MARK(X2)
MARK(leq(X1, X2)) → MARK(X2)
ACTIVE(p(s(X))) → MARK(X)
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(s(X)) → ACTIVE(s(mark(X)))
MARK(leq(X1, X2)) → MARK(X1)
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
MARK(leq(X1, X2)) → ACTIVE(leq(mark(X1), mark(X2)))
MARK(p(X)) → MARK(X)
ACTIVE(if(true, X, Y)) → MARK(X)

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


MARK(s(X)) → ACTIVE(s(mark(X)))
The remaining pairs can at least be oriented weakly.

MARK(diff(X1, X2)) → MARK(X1)
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(p(X)) → ACTIVE(p(mark(X)))
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
MARK(diff(X1, X2)) → MARK(X2)
MARK(leq(X1, X2)) → MARK(X2)
ACTIVE(p(s(X))) → MARK(X)
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(leq(X1, X2)) → MARK(X1)
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
MARK(leq(X1, X2)) → ACTIVE(leq(mark(X1), mark(X2)))
MARK(p(X)) → MARK(X)
ACTIVE(if(true, X, Y)) → MARK(X)
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(ACTIVE(x1)) = x1   
POL(MARK(x1)) = 1   
POL(active(x1)) = 0   
POL(diff(x1, x2)) = 1   
POL(false) = 0   
POL(if(x1, x2, x3)) = 1   
POL(leq(x1, x2)) = 1   
POL(mark(x1)) = 0   
POL(p(x1)) = 1   
POL(s(x1)) = 0   
POL(true) = 0   

The following usable rules [17] were oriented:

diff(X1, active(X2)) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(mark(X1), X2) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
p(active(X)) → p(X)
p(mark(X)) → p(X)
s(active(X)) → s(X)
s(mark(X)) → s(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
leq(X1, active(X2)) → leq(X1, X2)
leq(mark(X1), X2) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
QDP
                ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(diff(X1, X2)) → MARK(X1)
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(p(X)) → ACTIVE(p(mark(X)))
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
MARK(diff(X1, X2)) → MARK(X2)
MARK(leq(X1, X2)) → MARK(X2)
ACTIVE(p(s(X))) → MARK(X)
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(leq(X1, X2)) → MARK(X1)
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
MARK(leq(X1, X2)) → ACTIVE(leq(mark(X1), mark(X2)))
MARK(p(X)) → MARK(X)
ACTIVE(if(true, X, Y)) → MARK(X)

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(p(X)) → ACTIVE(p(mark(X))) at position [0] we obtained the following new rules:

MARK(p(if(x0, x1, x2))) → ACTIVE(p(active(if(mark(x0), x1, x2))))
MARK(p(leq(x0, x1))) → ACTIVE(p(active(leq(mark(x0), mark(x1)))))
MARK(p(true)) → ACTIVE(p(active(true)))
MARK(p(false)) → ACTIVE(p(active(false)))
MARK(p(0)) → ACTIVE(p(active(0)))
MARK(p(diff(x0, x1))) → ACTIVE(p(active(diff(mark(x0), mark(x1)))))
MARK(p(x0)) → ACTIVE(p(x0))
MARK(p(s(x0))) → ACTIVE(p(active(s(mark(x0)))))
MARK(p(p(x0))) → ACTIVE(p(active(p(mark(x0)))))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
QDP
                    ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(diff(X1, X2)) → MARK(X1)
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(p(leq(x0, x1))) → ACTIVE(p(active(leq(mark(x0), mark(x1)))))
MARK(p(true)) → ACTIVE(p(active(true)))
MARK(diff(X1, X2)) → MARK(X2)
MARK(leq(X1, X2)) → MARK(X2)
ACTIVE(p(s(X))) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(leq(X1, X2)) → MARK(X1)
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
MARK(p(X)) → MARK(X)
MARK(p(s(x0))) → ACTIVE(p(active(s(mark(x0)))))
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
MARK(p(if(x0, x1, x2))) → ACTIVE(p(active(if(mark(x0), x1, x2))))
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
MARK(p(false)) → ACTIVE(p(active(false)))
MARK(p(diff(x0, x1))) → ACTIVE(p(active(diff(mark(x0), mark(x1)))))
MARK(p(x0)) → ACTIVE(p(x0))
MARK(p(p(x0))) → ACTIVE(p(active(p(mark(x0)))))
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
MARK(leq(X1, X2)) → ACTIVE(leq(mark(X1), mark(X2)))
MARK(p(0)) → ACTIVE(p(active(0)))
ACTIVE(if(true, X, Y)) → MARK(X)

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3)) at position [0] we obtained the following new rules:

MARK(if(p(x0), y1, y2)) → ACTIVE(if(active(p(mark(x0))), y1, y2))
MARK(if(leq(x0, x1), y1, y2)) → ACTIVE(if(active(leq(mark(x0), mark(x1))), y1, y2))
MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(if(diff(x0, x1), y1, y2)) → ACTIVE(if(active(diff(mark(x0), mark(x1))), y1, y2))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
QDP
                        ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(diff(X1, X2)) → MARK(X1)
MARK(if(leq(x0, x1), y1, y2)) → ACTIVE(if(active(leq(mark(x0), mark(x1))), y1, y2))
MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(p(leq(x0, x1))) → ACTIVE(p(active(leq(mark(x0), mark(x1)))))
MARK(p(true)) → ACTIVE(p(active(true)))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(leq(X1, X2)) → MARK(X2)
MARK(diff(X1, X2)) → MARK(X2)
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(p(s(X))) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(leq(X1, X2)) → MARK(X1)
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
MARK(p(X)) → MARK(X)
MARK(p(s(x0))) → ACTIVE(p(active(s(mark(x0)))))
MARK(if(p(x0), y1, y2)) → ACTIVE(if(active(p(mark(x0))), y1, y2))
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
MARK(p(if(x0, x1, x2))) → ACTIVE(p(active(if(mark(x0), x1, x2))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(p(false)) → ACTIVE(p(active(false)))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(p(diff(x0, x1))) → ACTIVE(p(active(diff(mark(x0), mark(x1)))))
MARK(p(x0)) → ACTIVE(p(x0))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(p(p(x0))) → ACTIVE(p(active(p(mark(x0)))))
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
MARK(if(diff(x0, x1), y1, y2)) → ACTIVE(if(active(diff(mark(x0), mark(x1))), y1, y2))
MARK(leq(X1, X2)) → ACTIVE(leq(mark(X1), mark(X2)))
MARK(p(0)) → ACTIVE(p(active(0)))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(leq(X1, X2)) → ACTIVE(leq(mark(X1), mark(X2))) at position [0] we obtained the following new rules:

MARK(leq(y0, x1)) → ACTIVE(leq(mark(y0), x1))
MARK(leq(p(x0), y1)) → ACTIVE(leq(active(p(mark(x0))), mark(y1)))
MARK(leq(y0, s(x0))) → ACTIVE(leq(mark(y0), active(s(mark(x0)))))
MARK(leq(leq(x0, x1), y1)) → ACTIVE(leq(active(leq(mark(x0), mark(x1))), mark(y1)))
MARK(leq(0, y1)) → ACTIVE(leq(active(0), mark(y1)))
MARK(leq(y0, 0)) → ACTIVE(leq(mark(y0), active(0)))
MARK(leq(y0, if(x0, x1, x2))) → ACTIVE(leq(mark(y0), active(if(mark(x0), x1, x2))))
MARK(leq(diff(x0, x1), y1)) → ACTIVE(leq(active(diff(mark(x0), mark(x1))), mark(y1)))
MARK(leq(y0, leq(x0, x1))) → ACTIVE(leq(mark(y0), active(leq(mark(x0), mark(x1)))))
MARK(leq(if(x0, x1, x2), y1)) → ACTIVE(leq(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(leq(y0, diff(x0, x1))) → ACTIVE(leq(mark(y0), active(diff(mark(x0), mark(x1)))))
MARK(leq(y0, false)) → ACTIVE(leq(mark(y0), active(false)))
MARK(leq(false, y1)) → ACTIVE(leq(active(false), mark(y1)))
MARK(leq(y0, true)) → ACTIVE(leq(mark(y0), active(true)))
MARK(leq(true, y1)) → ACTIVE(leq(active(true), mark(y1)))
MARK(leq(s(x0), y1)) → ACTIVE(leq(active(s(mark(x0))), mark(y1)))
MARK(leq(y0, p(x0))) → ACTIVE(leq(mark(y0), active(p(mark(x0)))))
MARK(leq(x0, y1)) → ACTIVE(leq(x0, mark(y1)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(leq(0, y1)) → ACTIVE(leq(active(0), mark(y1)))
MARK(leq(y0, 0)) → ACTIVE(leq(mark(y0), active(0)))
MARK(p(true)) → ACTIVE(p(active(true)))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(leq(if(x0, x1, x2), y1)) → ACTIVE(leq(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(leq(X1, X2)) → MARK(X2)
MARK(diff(X1, X2)) → MARK(X2)
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(p(s(X))) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(leq(X1, X2)) → MARK(X1)
MARK(p(X)) → MARK(X)
MARK(leq(x0, y1)) → ACTIVE(leq(x0, mark(y1)))
MARK(leq(y0, x1)) → ACTIVE(leq(mark(y0), x1))
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
MARK(leq(p(x0), y1)) → ACTIVE(leq(active(p(mark(x0))), mark(y1)))
MARK(leq(leq(x0, x1), y1)) → ACTIVE(leq(active(leq(mark(x0), mark(x1))), mark(y1)))
MARK(leq(diff(x0, x1), y1)) → ACTIVE(leq(active(diff(mark(x0), mark(x1))), mark(y1)))
MARK(p(false)) → ACTIVE(p(active(false)))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(p(diff(x0, x1))) → ACTIVE(p(active(diff(mark(x0), mark(x1)))))
MARK(leq(y0, diff(x0, x1))) → ACTIVE(leq(mark(y0), active(diff(mark(x0), mark(x1)))))
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
MARK(if(diff(x0, x1), y1, y2)) → ACTIVE(if(active(diff(mark(x0), mark(x1))), y1, y2))
MARK(p(0)) → ACTIVE(p(active(0)))
MARK(leq(y0, p(x0))) → ACTIVE(leq(mark(y0), active(p(mark(x0)))))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(diff(X1, X2)) → MARK(X1)
MARK(if(leq(x0, x1), y1, y2)) → ACTIVE(if(active(leq(mark(x0), mark(x1))), y1, y2))
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(p(leq(x0, x1))) → ACTIVE(p(active(leq(mark(x0), mark(x1)))))
MARK(leq(y0, if(x0, x1, x2))) → ACTIVE(leq(mark(y0), active(if(mark(x0), x1, x2))))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(leq(y0, false)) → ACTIVE(leq(mark(y0), active(false)))
MARK(leq(false, y1)) → ACTIVE(leq(active(false), mark(y1)))
MARK(leq(true, y1)) → ACTIVE(leq(active(true), mark(y1)))
MARK(leq(y0, true)) → ACTIVE(leq(mark(y0), active(true)))
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
MARK(leq(s(x0), y1)) → ACTIVE(leq(active(s(mark(x0))), mark(y1)))
MARK(p(s(x0))) → ACTIVE(p(active(s(mark(x0)))))
MARK(if(p(x0), y1, y2)) → ACTIVE(if(active(p(mark(x0))), y1, y2))
MARK(leq(y0, s(x0))) → ACTIVE(leq(mark(y0), active(s(mark(x0)))))
MARK(p(if(x0, x1, x2))) → ACTIVE(p(active(if(mark(x0), x1, x2))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(leq(y0, leq(x0, x1))) → ACTIVE(leq(mark(y0), active(leq(mark(x0), mark(x1)))))
MARK(p(x0)) → ACTIVE(p(x0))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(p(p(x0))) → ACTIVE(p(active(p(mark(x0)))))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(p(true)) → ACTIVE(p(active(true))) at position [0] we obtained the following new rules:

MARK(p(true)) → ACTIVE(p(true))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
QDP
                                ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(leq(y0, 0)) → ACTIVE(leq(mark(y0), active(0)))
MARK(leq(0, y1)) → ACTIVE(leq(active(0), mark(y1)))
MARK(leq(if(x0, x1, x2), y1)) → ACTIVE(leq(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(diff(X1, X2)) → MARK(X2)
MARK(leq(X1, X2)) → MARK(X2)
ACTIVE(p(s(X))) → MARK(X)
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(leq(X1, X2)) → MARK(X1)
MARK(p(X)) → MARK(X)
MARK(leq(x0, y1)) → ACTIVE(leq(x0, mark(y1)))
MARK(leq(y0, x1)) → ACTIVE(leq(mark(y0), x1))
MARK(leq(p(x0), y1)) → ACTIVE(leq(active(p(mark(x0))), mark(y1)))
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
MARK(leq(leq(x0, x1), y1)) → ACTIVE(leq(active(leq(mark(x0), mark(x1))), mark(y1)))
MARK(leq(diff(x0, x1), y1)) → ACTIVE(leq(active(diff(mark(x0), mark(x1))), mark(y1)))
MARK(p(false)) → ACTIVE(p(active(false)))
MARK(p(diff(x0, x1))) → ACTIVE(p(active(diff(mark(x0), mark(x1)))))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(leq(y0, diff(x0, x1))) → ACTIVE(leq(mark(y0), active(diff(mark(x0), mark(x1)))))
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
MARK(if(diff(x0, x1), y1, y2)) → ACTIVE(if(active(diff(mark(x0), mark(x1))), y1, y2))
MARK(p(0)) → ACTIVE(p(active(0)))
MARK(leq(y0, p(x0))) → ACTIVE(leq(mark(y0), active(p(mark(x0)))))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(diff(X1, X2)) → MARK(X1)
MARK(if(leq(x0, x1), y1, y2)) → ACTIVE(if(active(leq(mark(x0), mark(x1))), y1, y2))
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(leq(y0, if(x0, x1, x2))) → ACTIVE(leq(mark(y0), active(if(mark(x0), x1, x2))))
MARK(p(leq(x0, x1))) → ACTIVE(p(active(leq(mark(x0), mark(x1)))))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(leq(false, y1)) → ACTIVE(leq(active(false), mark(y1)))
MARK(leq(y0, false)) → ACTIVE(leq(mark(y0), active(false)))
MARK(leq(y0, true)) → ACTIVE(leq(mark(y0), active(true)))
MARK(leq(true, y1)) → ACTIVE(leq(active(true), mark(y1)))
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
MARK(leq(s(x0), y1)) → ACTIVE(leq(active(s(mark(x0))), mark(y1)))
MARK(p(s(x0))) → ACTIVE(p(active(s(mark(x0)))))
MARK(if(p(x0), y1, y2)) → ACTIVE(if(active(p(mark(x0))), y1, y2))
MARK(leq(y0, s(x0))) → ACTIVE(leq(mark(y0), active(s(mark(x0)))))
MARK(p(if(x0, x1, x2))) → ACTIVE(p(active(if(mark(x0), x1, x2))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(leq(y0, leq(x0, x1))) → ACTIVE(leq(mark(y0), active(leq(mark(x0), mark(x1)))))
MARK(p(true)) → ACTIVE(p(true))
MARK(p(x0)) → ACTIVE(p(x0))
MARK(p(p(x0))) → ACTIVE(p(active(p(mark(x0)))))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ DependencyGraphProof
QDP
                                    ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(leq(0, y1)) → ACTIVE(leq(active(0), mark(y1)))
MARK(leq(y0, 0)) → ACTIVE(leq(mark(y0), active(0)))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(leq(if(x0, x1, x2), y1)) → ACTIVE(leq(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(leq(X1, X2)) → MARK(X2)
MARK(diff(X1, X2)) → MARK(X2)
ACTIVE(p(s(X))) → MARK(X)
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(leq(X1, X2)) → MARK(X1)
MARK(p(X)) → MARK(X)
MARK(leq(x0, y1)) → ACTIVE(leq(x0, mark(y1)))
MARK(leq(y0, x1)) → ACTIVE(leq(mark(y0), x1))
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
MARK(leq(p(x0), y1)) → ACTIVE(leq(active(p(mark(x0))), mark(y1)))
MARK(leq(leq(x0, x1), y1)) → ACTIVE(leq(active(leq(mark(x0), mark(x1))), mark(y1)))
MARK(leq(diff(x0, x1), y1)) → ACTIVE(leq(active(diff(mark(x0), mark(x1))), mark(y1)))
MARK(p(false)) → ACTIVE(p(active(false)))
MARK(p(diff(x0, x1))) → ACTIVE(p(active(diff(mark(x0), mark(x1)))))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(leq(y0, diff(x0, x1))) → ACTIVE(leq(mark(y0), active(diff(mark(x0), mark(x1)))))
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
MARK(if(diff(x0, x1), y1, y2)) → ACTIVE(if(active(diff(mark(x0), mark(x1))), y1, y2))
MARK(p(0)) → ACTIVE(p(active(0)))
MARK(leq(y0, p(x0))) → ACTIVE(leq(mark(y0), active(p(mark(x0)))))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(diff(X1, X2)) → MARK(X1)
MARK(if(leq(x0, x1), y1, y2)) → ACTIVE(if(active(leq(mark(x0), mark(x1))), y1, y2))
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(p(leq(x0, x1))) → ACTIVE(p(active(leq(mark(x0), mark(x1)))))
MARK(leq(y0, if(x0, x1, x2))) → ACTIVE(leq(mark(y0), active(if(mark(x0), x1, x2))))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(leq(y0, false)) → ACTIVE(leq(mark(y0), active(false)))
MARK(leq(false, y1)) → ACTIVE(leq(active(false), mark(y1)))
MARK(leq(y0, true)) → ACTIVE(leq(mark(y0), active(true)))
MARK(leq(true, y1)) → ACTIVE(leq(active(true), mark(y1)))
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
MARK(leq(s(x0), y1)) → ACTIVE(leq(active(s(mark(x0))), mark(y1)))
MARK(p(s(x0))) → ACTIVE(p(active(s(mark(x0)))))
MARK(if(p(x0), y1, y2)) → ACTIVE(if(active(p(mark(x0))), y1, y2))
MARK(leq(y0, s(x0))) → ACTIVE(leq(mark(y0), active(s(mark(x0)))))
MARK(p(if(x0, x1, x2))) → ACTIVE(p(active(if(mark(x0), x1, x2))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(leq(y0, leq(x0, x1))) → ACTIVE(leq(mark(y0), active(leq(mark(x0), mark(x1)))))
MARK(p(x0)) → ACTIVE(p(x0))
MARK(p(p(x0))) → ACTIVE(p(active(p(mark(x0)))))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(p(false)) → ACTIVE(p(active(false))) at position [0] we obtained the following new rules:

MARK(p(false)) → ACTIVE(p(false))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ DependencyGraphProof
                                  ↳ QDP
                                    ↳ Narrowing
QDP
                                        ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(leq(y0, 0)) → ACTIVE(leq(mark(y0), active(0)))
MARK(leq(0, y1)) → ACTIVE(leq(active(0), mark(y1)))
MARK(leq(if(x0, x1, x2), y1)) → ACTIVE(leq(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(diff(X1, X2)) → MARK(X2)
MARK(leq(X1, X2)) → MARK(X2)
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(p(s(X))) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(leq(X1, X2)) → MARK(X1)
MARK(p(X)) → MARK(X)
MARK(leq(x0, y1)) → ACTIVE(leq(x0, mark(y1)))
MARK(leq(y0, x1)) → ACTIVE(leq(mark(y0), x1))
MARK(leq(p(x0), y1)) → ACTIVE(leq(active(p(mark(x0))), mark(y1)))
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
MARK(leq(leq(x0, x1), y1)) → ACTIVE(leq(active(leq(mark(x0), mark(x1))), mark(y1)))
MARK(leq(diff(x0, x1), y1)) → ACTIVE(leq(active(diff(mark(x0), mark(x1))), mark(y1)))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(p(diff(x0, x1))) → ACTIVE(p(active(diff(mark(x0), mark(x1)))))
MARK(leq(y0, diff(x0, x1))) → ACTIVE(leq(mark(y0), active(diff(mark(x0), mark(x1)))))
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
MARK(if(diff(x0, x1), y1, y2)) → ACTIVE(if(active(diff(mark(x0), mark(x1))), y1, y2))
MARK(p(0)) → ACTIVE(p(active(0)))
MARK(leq(y0, p(x0))) → ACTIVE(leq(mark(y0), active(p(mark(x0)))))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(diff(X1, X2)) → MARK(X1)
MARK(if(leq(x0, x1), y1, y2)) → ACTIVE(if(active(leq(mark(x0), mark(x1))), y1, y2))
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(leq(y0, if(x0, x1, x2))) → ACTIVE(leq(mark(y0), active(if(mark(x0), x1, x2))))
MARK(p(leq(x0, x1))) → ACTIVE(p(active(leq(mark(x0), mark(x1)))))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(leq(false, y1)) → ACTIVE(leq(active(false), mark(y1)))
MARK(leq(y0, false)) → ACTIVE(leq(mark(y0), active(false)))
MARK(leq(true, y1)) → ACTIVE(leq(active(true), mark(y1)))
MARK(leq(y0, true)) → ACTIVE(leq(mark(y0), active(true)))
MARK(p(false)) → ACTIVE(p(false))
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
MARK(leq(s(x0), y1)) → ACTIVE(leq(active(s(mark(x0))), mark(y1)))
MARK(p(s(x0))) → ACTIVE(p(active(s(mark(x0)))))
MARK(if(p(x0), y1, y2)) → ACTIVE(if(active(p(mark(x0))), y1, y2))
MARK(leq(y0, s(x0))) → ACTIVE(leq(mark(y0), active(s(mark(x0)))))
MARK(p(if(x0, x1, x2))) → ACTIVE(p(active(if(mark(x0), x1, x2))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(leq(y0, leq(x0, x1))) → ACTIVE(leq(mark(y0), active(leq(mark(x0), mark(x1)))))
MARK(p(x0)) → ACTIVE(p(x0))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(p(p(x0))) → ACTIVE(p(active(p(mark(x0)))))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ DependencyGraphProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
QDP
                                            ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(leq(0, y1)) → ACTIVE(leq(active(0), mark(y1)))
MARK(leq(y0, 0)) → ACTIVE(leq(mark(y0), active(0)))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(leq(if(x0, x1, x2), y1)) → ACTIVE(leq(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(leq(X1, X2)) → MARK(X2)
MARK(diff(X1, X2)) → MARK(X2)
ACTIVE(p(s(X))) → MARK(X)
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(leq(X1, X2)) → MARK(X1)
MARK(p(X)) → MARK(X)
MARK(leq(x0, y1)) → ACTIVE(leq(x0, mark(y1)))
MARK(leq(y0, x1)) → ACTIVE(leq(mark(y0), x1))
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
MARK(leq(p(x0), y1)) → ACTIVE(leq(active(p(mark(x0))), mark(y1)))
MARK(leq(leq(x0, x1), y1)) → ACTIVE(leq(active(leq(mark(x0), mark(x1))), mark(y1)))
MARK(leq(diff(x0, x1), y1)) → ACTIVE(leq(active(diff(mark(x0), mark(x1))), mark(y1)))
MARK(p(diff(x0, x1))) → ACTIVE(p(active(diff(mark(x0), mark(x1)))))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(leq(y0, diff(x0, x1))) → ACTIVE(leq(mark(y0), active(diff(mark(x0), mark(x1)))))
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
MARK(if(diff(x0, x1), y1, y2)) → ACTIVE(if(active(diff(mark(x0), mark(x1))), y1, y2))
MARK(p(0)) → ACTIVE(p(active(0)))
MARK(leq(y0, p(x0))) → ACTIVE(leq(mark(y0), active(p(mark(x0)))))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(diff(X1, X2)) → MARK(X1)
MARK(if(leq(x0, x1), y1, y2)) → ACTIVE(if(active(leq(mark(x0), mark(x1))), y1, y2))
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(p(leq(x0, x1))) → ACTIVE(p(active(leq(mark(x0), mark(x1)))))
MARK(leq(y0, if(x0, x1, x2))) → ACTIVE(leq(mark(y0), active(if(mark(x0), x1, x2))))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(leq(y0, false)) → ACTIVE(leq(mark(y0), active(false)))
MARK(leq(false, y1)) → ACTIVE(leq(active(false), mark(y1)))
MARK(leq(y0, true)) → ACTIVE(leq(mark(y0), active(true)))
MARK(leq(true, y1)) → ACTIVE(leq(active(true), mark(y1)))
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
MARK(leq(s(x0), y1)) → ACTIVE(leq(active(s(mark(x0))), mark(y1)))
MARK(p(s(x0))) → ACTIVE(p(active(s(mark(x0)))))
MARK(if(p(x0), y1, y2)) → ACTIVE(if(active(p(mark(x0))), y1, y2))
MARK(leq(y0, s(x0))) → ACTIVE(leq(mark(y0), active(s(mark(x0)))))
MARK(p(if(x0, x1, x2))) → ACTIVE(p(active(if(mark(x0), x1, x2))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(leq(y0, leq(x0, x1))) → ACTIVE(leq(mark(y0), active(leq(mark(x0), mark(x1)))))
MARK(p(x0)) → ACTIVE(p(x0))
MARK(p(p(x0))) → ACTIVE(p(active(p(mark(x0)))))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule MARK(p(0)) → ACTIVE(p(active(0))) at position [0] we obtained the following new rules:

MARK(p(0)) → ACTIVE(p(0))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ DependencyGraphProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ Narrowing
QDP
                                                ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(p(0)) → ACTIVE(p(0))
MARK(leq(y0, 0)) → ACTIVE(leq(mark(y0), active(0)))
MARK(leq(0, y1)) → ACTIVE(leq(active(0), mark(y1)))
MARK(leq(if(x0, x1, x2), y1)) → ACTIVE(leq(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(diff(X1, X2)) → MARK(X2)
MARK(leq(X1, X2)) → MARK(X2)
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
ACTIVE(p(s(X))) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(leq(X1, X2)) → MARK(X1)
MARK(p(X)) → MARK(X)
MARK(leq(x0, y1)) → ACTIVE(leq(x0, mark(y1)))
MARK(leq(y0, x1)) → ACTIVE(leq(mark(y0), x1))
MARK(leq(p(x0), y1)) → ACTIVE(leq(active(p(mark(x0))), mark(y1)))
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
MARK(leq(leq(x0, x1), y1)) → ACTIVE(leq(active(leq(mark(x0), mark(x1))), mark(y1)))
MARK(leq(diff(x0, x1), y1)) → ACTIVE(leq(active(diff(mark(x0), mark(x1))), mark(y1)))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(p(diff(x0, x1))) → ACTIVE(p(active(diff(mark(x0), mark(x1)))))
MARK(leq(y0, diff(x0, x1))) → ACTIVE(leq(mark(y0), active(diff(mark(x0), mark(x1)))))
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
MARK(if(diff(x0, x1), y1, y2)) → ACTIVE(if(active(diff(mark(x0), mark(x1))), y1, y2))
MARK(leq(y0, p(x0))) → ACTIVE(leq(mark(y0), active(p(mark(x0)))))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(diff(X1, X2)) → MARK(X1)
MARK(if(leq(x0, x1), y1, y2)) → ACTIVE(if(active(leq(mark(x0), mark(x1))), y1, y2))
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(leq(y0, if(x0, x1, x2))) → ACTIVE(leq(mark(y0), active(if(mark(x0), x1, x2))))
MARK(p(leq(x0, x1))) → ACTIVE(p(active(leq(mark(x0), mark(x1)))))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(leq(false, y1)) → ACTIVE(leq(active(false), mark(y1)))
MARK(leq(y0, false)) → ACTIVE(leq(mark(y0), active(false)))
MARK(leq(true, y1)) → ACTIVE(leq(active(true), mark(y1)))
MARK(leq(y0, true)) → ACTIVE(leq(mark(y0), active(true)))
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
MARK(leq(s(x0), y1)) → ACTIVE(leq(active(s(mark(x0))), mark(y1)))
MARK(p(s(x0))) → ACTIVE(p(active(s(mark(x0)))))
MARK(if(p(x0), y1, y2)) → ACTIVE(if(active(p(mark(x0))), y1, y2))
MARK(leq(y0, s(x0))) → ACTIVE(leq(mark(y0), active(s(mark(x0)))))
MARK(p(if(x0, x1, x2))) → ACTIVE(p(active(if(mark(x0), x1, x2))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(leq(y0, leq(x0, x1))) → ACTIVE(leq(mark(y0), active(leq(mark(x0), mark(x1)))))
MARK(p(x0)) → ACTIVE(p(x0))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
MARK(p(p(x0))) → ACTIVE(p(active(p(mark(x0)))))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ Narrowing
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ DependencyGraphProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ Narrowing
                                              ↳ QDP
                                                ↳ DependencyGraphProof
QDP

Q DP problem:
The TRS P consists of the following rules:

MARK(if(0, y1, y2)) → ACTIVE(if(active(0), y1, y2))
MARK(leq(0, y1)) → ACTIVE(leq(active(0), mark(y1)))
MARK(leq(y0, 0)) → ACTIVE(leq(mark(y0), active(0)))
MARK(if(y0, active(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(leq(if(x0, x1, x2), y1)) → ACTIVE(leq(active(if(mark(x0), x1, x2)), mark(y1)))
MARK(leq(X1, X2)) → MARK(X2)
MARK(diff(X1, X2)) → MARK(X2)
ACTIVE(p(s(X))) → MARK(X)
MARK(if(y0, x1, mark(x2))) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(leq(X1, X2)) → MARK(X1)
MARK(p(X)) → MARK(X)
MARK(leq(x0, y1)) → ACTIVE(leq(x0, mark(y1)))
MARK(leq(y0, x1)) → ACTIVE(leq(mark(y0), x1))
ACTIVE(leq(s(X), s(Y))) → MARK(leq(X, Y))
MARK(leq(p(x0), y1)) → ACTIVE(leq(active(p(mark(x0))), mark(y1)))
MARK(leq(leq(x0, x1), y1)) → ACTIVE(leq(active(leq(mark(x0), mark(x1))), mark(y1)))
MARK(leq(diff(x0, x1), y1)) → ACTIVE(leq(active(diff(mark(x0), mark(x1))), mark(y1)))
MARK(if(x0, x1, x2)) → ACTIVE(if(x0, x1, x2))
MARK(p(diff(x0, x1))) → ACTIVE(p(active(diff(mark(x0), mark(x1)))))
MARK(leq(y0, diff(x0, x1))) → ACTIVE(leq(mark(y0), active(diff(mark(x0), mark(x1)))))
MARK(diff(X1, X2)) → ACTIVE(diff(mark(X1), mark(X2)))
MARK(if(diff(x0, x1), y1, y2)) → ACTIVE(if(active(diff(mark(x0), mark(x1))), y1, y2))
MARK(leq(y0, p(x0))) → ACTIVE(leq(mark(y0), active(p(mark(x0)))))
MARK(if(y0, mark(x1), x2)) → ACTIVE(if(mark(y0), x1, x2))
MARK(if(if(x0, x1, x2), y1, y2)) → ACTIVE(if(active(if(mark(x0), x1, x2)), y1, y2))
MARK(diff(X1, X2)) → MARK(X1)
MARK(if(leq(x0, x1), y1, y2)) → ACTIVE(if(active(leq(mark(x0), mark(x1))), y1, y2))
MARK(s(X)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(p(leq(x0, x1))) → ACTIVE(p(active(leq(mark(x0), mark(x1)))))
MARK(leq(y0, if(x0, x1, x2))) → ACTIVE(leq(mark(y0), active(if(mark(x0), x1, x2))))
MARK(if(true, y1, y2)) → ACTIVE(if(active(true), y1, y2))
MARK(leq(y0, false)) → ACTIVE(leq(mark(y0), active(false)))
MARK(leq(false, y1)) → ACTIVE(leq(active(false), mark(y1)))
MARK(leq(y0, true)) → ACTIVE(leq(mark(y0), active(true)))
MARK(leq(true, y1)) → ACTIVE(leq(active(true), mark(y1)))
ACTIVE(diff(X, Y)) → MARK(if(leq(X, Y), 0, s(diff(p(X), Y))))
MARK(leq(s(x0), y1)) → ACTIVE(leq(active(s(mark(x0))), mark(y1)))
MARK(p(s(x0))) → ACTIVE(p(active(s(mark(x0)))))
MARK(if(p(x0), y1, y2)) → ACTIVE(if(active(p(mark(x0))), y1, y2))
MARK(leq(y0, s(x0))) → ACTIVE(leq(mark(y0), active(s(mark(x0)))))
MARK(p(if(x0, x1, x2))) → ACTIVE(p(active(if(mark(x0), x1, x2))))
MARK(if(s(x0), y1, y2)) → ACTIVE(if(active(s(mark(x0))), y1, y2))
MARK(leq(y0, leq(x0, x1))) → ACTIVE(leq(mark(y0), active(leq(mark(x0), mark(x1)))))
MARK(p(x0)) → ACTIVE(p(x0))
MARK(p(p(x0))) → ACTIVE(p(active(p(mark(x0)))))
MARK(if(false, y1, y2)) → ACTIVE(if(active(false), y1, y2))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(if(y0, x1, active(x2))) → ACTIVE(if(mark(y0), x1, x2))

The TRS R consists of the following rules:

active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.